import java.util.Scanner;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // 提示用户输入一个整数n
        System.out.print("请输入一个整数n: ");
        int n = scanner.nextInt();

        // 初始化奇数和变量
        int sum = 0;

       /* // 遍历从1到n的所有数，累加所有奇数
        for (int i = 1; i <= n; i++) {
            if (i % 2 != 0) {  // 判断i是否为奇数
                sum += i;
            }
        }*/

        sum = n/2*(1+n)/2;
        // 输出奇数和
        System.out.println("从1到" + n + "之间所有奇数的和是: " + sum);

        // 关闭scanner
        scanner.close();
    }
}